<template>
  <div>
    <h1>axios再次提炼</h1>
    用户名：<input type="text" v-model="user_name" /><br />
    密码：<input type="text" v-model="password" /><br />
    <button @click="register">注册</button>
  </div>
</template>

<script>
import { stu_info_request } from "@/api/stuInfo.js";
import { register_request } from "@/api/register.js";
export default {
  async mounted() {
    // 发送ajax请求
    let result = await stu_info_request();
    console.log(result);
  },
  data() {
    return {
      user_name: "",
      password: "",
    };
  },
  methods: {
    async register() {
      console.log(11);
      const user = {
        user_name: this.user_name,
        password: this.password,
      };
      let result = await register_request(user);
      console.log(result);
    },
  },
};
</script>

<style lang="scss" scoped>
</style>